import request from '@/utils/request'

// 分页获取权限列表
export function getPermissionList(params) {
  return request({
    url: '/permission/paged',
    method: 'get',
    params
  })
}

// 新增权限
export function addPermission(data) {
  return request({
    url: '/permission',
    method: 'post',
    data
  })
}

// 编辑权限
export function editPermission(permissionId, data) {
  return request({
    url: `/permission/${permissionId}`,
    method: 'put',
    data
  })
}

// 删除权限
export function deletePermission(permissionId) {
  return request({
    url: `/permission/${permissionId}`,
    method: 'delete'
  })
}

// 启用权限
export function enablePermission(permissionId) {
  return request({
    url: `/permission/enable/${permissionId}`,
    method: 'put'
  })
}

// 禁用权限
export function disablePermission(permissionId) {
  return request({
    url: `/permission/disable/${permissionId}`,
    method: 'put'
  })
}